from typing import List


class Solution:
    def twoSum(self, numbers: List[int], target: int) -> List[int]:
        a, b = 0, len(numbers) - 1
        while a < b and numbers[a] + numbers[b] != target:
            if numbers[a] + numbers[b] > target:
                b -= 1
            else:
                a += 1
        return [a, b]


if __name__ == "__main__":
    print(Solution().twoSum(numbers=[1, 2, 4, 6, 10], target=8))  # [1,3]
    print(Solution().twoSum(numbers=[2, 3, 4], target=6))  # [0,2]
    print(Solution().twoSum(numbers=[-1, 0], target=-1))  # [0,1]
